using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class index2 : System.Web.UI.Page
{

    #region CurrentPrivateSession
    PrivateLoginSession CurrentPrivateSession
    {
        get
        {
            return (PrivateLoginSession)ViewState[GonzalesCommonNamingConvention.CurrentPrivateSessionViewState];
        }

        set
        {
            ViewState[GonzalesCommonNamingConvention.CurrentPrivateSessionViewState] = value;
        }
    }
    #endregion

    #region Events

    #region Page_Load
    protected void Page_Load(object sender, EventArgs e)
    {
        SessionCheck();

        if (!IsPostBack)
        {
            this.Title = GonzalesSystemInformation.WebApplicationTitle;            
        }
        
    }
    #endregion

    #endregion

    #region Customized Methods

    #region SessionCheck
    public void SessionCheck()
    {
        if (!IsPostBack) this.CurrentPrivateSession = null; // always null for the first time

        if (this.CurrentPrivateSession == null)
        {
            if (Session[GonzalesCommonNamingConvention.CurrentPrivateSession] != null)
            {
                this.CurrentPrivateSession = (PrivateLoginSession)Session[GonzalesCommonNamingConvention.CurrentPrivateSession];
            }
            else
            {
                Response.Redirect(GonzalesErrorPageRedirect.SessionError);
            }
        }
    }
    #endregion

    #endregion
}
